// 获取当前页面的主机名
const hostname = window.location.host;

// 提取不带端口号的主机名
let index = hostname.indexOf(":");
let host;
if (index === -1) {
  host = hostname;
} else {
  host = hostname.substring(0, index);
}
if (host == "localhost") {
  host = "127.0.0.1";
}

// 导出主机名
export default host;
